// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: unnecessary_non_null_assertion
// ignore_for_file: unused_element
// ignore_for_file: unused_field
// ignore_for_file: unused_import
// coverage:ignore-file

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint
import 'dart:ffi' as ffi;
import 'package:objective_c/objective_c.dart' as objc;
import 'package:ffi/ffi.dart' as pkg_ffi;

/// WARNING: AVAudioFormatWrapper is a stub. To generate bindings for this class, include
/// AVAudioFormatWrapper in your config's objc-interfaces list.
///
/// AVAudioFormatWrapper
extension type AVAudioFormatWrapper._(objc.ObjCObject object$)
    implements objc.ObjCObject, objc.NSObject {
  /// Constructs a [AVAudioFormatWrapper] that points to the same underlying object as [other].
  AVAudioFormatWrapper.as(objc.ObjCObject other) : object$ = other {
    objc.checkOsVersionInternal(
      'AVAudioFormatWrapper',
      macOS: (false, (10, 10, 0)),
    );
  }

  /// Constructs a [AVAudioFormatWrapper] that wraps the given raw object pointer.
  AVAudioFormatWrapper.fromPointer(
    ffi.Pointer<objc.ObjCObjectImpl> other, {
    bool retain = false,
    bool release = false,
  }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {
    objc.checkOsVersionInternal(
      'AVAudioFormatWrapper',
      macOS: (false, (10, 10, 0)),
    );
  }
}

late final _class_AVAudioPlayerWrapper = objc.getClass(
  "AVFAudioWrapper.AVAudioPlayerWrapper",
);
late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:");
final _objc_msgSend_19nvye5 = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Bool Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Pointer<objc.ObjCObjectImpl>,
        )
      >
    >()
    .asFunction<
      bool Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        ffi.Pointer<objc.ObjCObjectImpl>,
      )
    >();
late final _sel_currentDevice = objc.registerName("currentDevice");
final _objc_msgSend_151sglz = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Pointer<objc.ObjCObjectImpl> Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      ffi.Pointer<objc.ObjCObjectImpl> Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
late final _sel_setCurrentDevice_ = objc.registerName("setCurrentDevice:");
final _objc_msgSend_xtuoz7 = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Void Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Pointer<objc.ObjCObjectImpl>,
        )
      >
    >()
    .asFunction<
      void Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        ffi.Pointer<objc.ObjCObjectImpl>,
      )
    >();
late final _sel_currentTime = objc.registerName("currentTime");
final _objc_msgSend_1ukqyt8 = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Double Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      double Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer
    .cast<
      ffi.NativeFunction<
        ffi.Double Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      double Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
late final _sel_setCurrentTime_ = objc.registerName("setCurrentTime:");
final _objc_msgSend_hwm8nu = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Void Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Double,
        )
      >
    >()
    .asFunction<
      void Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        double,
      )
    >();
late final _sel_data = objc.registerName("data");
late final _sel_deviceCurrentTime = objc.registerName("deviceCurrentTime");
late final _sel_duration = objc.registerName("duration");
late final _sel_enableRate = objc.registerName("enableRate");
final _objc_msgSend_91o635 = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Bool Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      bool Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
late final _sel_setEnableRate_ = objc.registerName("setEnableRate:");
final _objc_msgSend_1s56lr9 = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Void Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Bool,
        )
      >
    >()
    .asFunction<
      void Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        bool,
      )
    >();
late final _sel_format = objc.registerName("format");
late final _sel_isMeteringEnabled = objc.registerName("isMeteringEnabled");
late final _sel_setIsMeteringEnabled_ = objc.registerName(
  "setIsMeteringEnabled:",
);
late final _sel_numberOfChannels = objc.registerName("numberOfChannels");
final _objc_msgSend_1hz7y9r = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Long Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      int Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
late final _sel_numberOfLoops = objc.registerName("numberOfLoops");
late final _sel_setNumberOfLoops_ = objc.registerName("setNumberOfLoops:");
final _objc_msgSend_4sp4xj = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Void Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Long,
        )
      >
    >()
    .asFunction<
      void Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        int,
      )
    >();
late final _sel_pan = objc.registerName("pan");
final _objc_msgSend_2cgrxl = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Float Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      double Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer
    .cast<
      ffi.NativeFunction<
        ffi.Float Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      double Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
late final _sel_setPan_ = objc.registerName("setPan:");
final _objc_msgSend_v5hmet = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Void Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Float,
        )
      >
    >()
    .asFunction<
      void Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        double,
      )
    >();
late final _sel_isPlaying = objc.registerName("isPlaying");
late final _sel_rate = objc.registerName("rate");
late final _sel_setRate_ = objc.registerName("setRate:");
late final _sel_url = objc.registerName("url");
late final _sel_volume = objc.registerName("volume");
late final _sel_setVolume_ = objc.registerName("setVolume:");
typedef instancetype = ffi.Pointer<objc.ObjCObjectImpl>;
typedef Dartinstancetype = objc.ObjCObject;
late final _sel_initWithContentsOf_error_ = objc.registerName(
  "initWithContentsOf:error:",
);
final _objc_msgSend_1lhpu4m = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Pointer<objc.ObjCObjectImpl> Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<ffi.Pointer<objc.ObjCObjectImpl>>,
        )
      >
    >()
    .asFunction<
      ffi.Pointer<objc.ObjCObjectImpl> Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<ffi.Pointer<objc.ObjCObjectImpl>>,
      )
    >();
late final _sel_initWithContentsOf_fileTypeHint_error_ = objc.registerName(
  "initWithContentsOf:fileTypeHint:error:",
);
final _objc_msgSend_1pnyuds = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Pointer<objc.ObjCObjectImpl> Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<ffi.Pointer<objc.ObjCObjectImpl>>,
        )
      >
    >()
    .asFunction<
      ffi.Pointer<objc.ObjCObjectImpl> Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<ffi.Pointer<objc.ObjCObjectImpl>>,
      )
    >();
late final _sel_initWithData_error_ = objc.registerName("initWithData:error:");
late final _sel_initWithData_fileTypeHint_error_ = objc.registerName(
  "initWithData:fileTypeHint:error:",
);
late final _sel_averagePowerForChannel_ = objc.registerName(
  "averagePowerForChannel:",
);
final _objc_msgSend_1o3b4v9 = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Float Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Long,
        )
      >
    >()
    .asFunction<
      double Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        int,
      )
    >();
final _objc_msgSend_1o3b4v9Fpret = objc.msgSendFpretPointer
    .cast<
      ffi.NativeFunction<
        ffi.Float Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Long,
        )
      >
    >()
    .asFunction<
      double Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        int,
      )
    >();
late final _sel_pause = objc.registerName("pause");
final _objc_msgSend_1pl9qdv = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Void Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
        )
      >
    >()
    .asFunction<
      void Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
      )
    >();
late final _sel_peakPowerForChannel_ = objc.registerName(
  "peakPowerForChannel:",
);
late final _sel_play = objc.registerName("play");
late final _sel_playAtTime_ = objc.registerName("playAtTime:");
final _objc_msgSend_18chyc = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Bool Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Double,
        )
      >
    >()
    .asFunction<
      bool Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        double,
      )
    >();
late final _sel_prepareToPlay = objc.registerName("prepareToPlay");
late final _sel_setVolume_fadeDuration_ = objc.registerName(
  "setVolume:fadeDuration:",
);
final _objc_msgSend_1p4uk9e = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Void Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Float,
          ffi.Double,
        )
      >
    >()
    .asFunction<
      void Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        double,
        double,
      )
    >();
late final _sel_stop = objc.registerName("stop");
late final _sel_updateMeters = objc.registerName("updateMeters");
late final _sel_init = objc.registerName("init");
late final _sel_new = objc.registerName("new");
late final _sel_allocWithZone_ = objc.registerName("allocWithZone:");
final _objc_msgSend_1cwp428 = objc.msgSendPointer
    .cast<
      ffi.NativeFunction<
        ffi.Pointer<objc.ObjCObjectImpl> Function(
          ffi.Pointer<objc.ObjCObjectImpl>,
          ffi.Pointer<objc.ObjCSelector>,
          ffi.Pointer<objc.NSZone>,
        )
      >
    >()
    .asFunction<
      ffi.Pointer<objc.ObjCObjectImpl> Function(
        ffi.Pointer<objc.ObjCObjectImpl>,
        ffi.Pointer<objc.ObjCSelector>,
        ffi.Pointer<objc.NSZone>,
      )
    >();
late final _sel_alloc = objc.registerName("alloc");

/// AVAudioPlayerWrapper
extension type AVAudioPlayerWrapper._(objc.ObjCObject object$)
    implements objc.ObjCObject, objc.NSObject {
  /// Constructs a [AVAudioPlayerWrapper] that points to the same underlying object as [other].
  AVAudioPlayerWrapper.as(objc.ObjCObject other) : object$ = other {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper',
      macOS: (false, (10, 7, 0)),
    );
    assert(isA(object$));
  }

  /// Constructs a [AVAudioPlayerWrapper] that wraps the given raw object pointer.
  AVAudioPlayerWrapper.fromPointer(
    ffi.Pointer<objc.ObjCObjectImpl> other, {
    bool retain = false,
    bool release = false,
  }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper',
      macOS: (false, (10, 7, 0)),
    );
    assert(isA(object$));
  }

  /// Returns whether [obj] is an instance of [AVAudioPlayerWrapper].
  static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(
    obj.ref.pointer,
    _sel_isKindOfClass_,
    _class_AVAudioPlayerWrapper,
  );

  /// alloc
  static AVAudioPlayerWrapper alloc() {
    final $ret = _objc_msgSend_151sglz(_class_AVAudioPlayerWrapper, _sel_alloc);
    return AVAudioPlayerWrapper.fromPointer($ret, retain: false, release: true);
  }

  /// allocWithZone:
  static AVAudioPlayerWrapper allocWithZone(ffi.Pointer<objc.NSZone> zone) {
    final $ret = _objc_msgSend_1cwp428(
      _class_AVAudioPlayerWrapper,
      _sel_allocWithZone_,
      zone,
    );
    return AVAudioPlayerWrapper.fromPointer($ret, retain: false, release: true);
  }

  /// new
  static AVAudioPlayerWrapper new$() {
    final $ret = _objc_msgSend_151sglz(_class_AVAudioPlayerWrapper, _sel_new);
    return AVAudioPlayerWrapper.fromPointer($ret, retain: false, release: true);
  }

  /// Returns a new instance of AVAudioPlayerWrapper constructed with the default `new` method.
  AVAudioPlayerWrapper() : this.as(new$().object$);
}

extension AVAudioPlayerWrapper$Methods on AVAudioPlayerWrapper {
  /// averagePowerForChannel:
  double averagePowerForChannel(int channelNumber) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.averagePowerForChannel:',
      macOS: (false, (10, 7, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_1o3b4v9Fpret(
            object$.ref.pointer,
            _sel_averagePowerForChannel_,
            channelNumber,
          )
        : _objc_msgSend_1o3b4v9(
            object$.ref.pointer,
            _sel_averagePowerForChannel_,
            channelNumber,
          );
  }

  /// currentDevice
  objc.NSString? get currentDevice {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.currentDevice',
      macOS: (false, (10, 13, 0)),
    );
    final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_currentDevice);
    return $ret.address == 0
        ? null
        : objc.NSString.fromPointer($ret, retain: true, release: true);
  }

  /// currentTime
  double get currentTime {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.currentTime',
      macOS: (false, (10, 7, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_currentTime)
        : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_currentTime);
  }

  /// data
  objc.NSData? get data {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.data',
      macOS: (false, (10, 7, 0)),
    );
    final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_data);
    return $ret.address == 0
        ? null
        : objc.NSData.fromPointer($ret, retain: true, release: true);
  }

  /// deviceCurrentTime
  double get deviceCurrentTime {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.deviceCurrentTime',
      macOS: (false, (10, 7, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_1ukqyt8Fpret(
            object$.ref.pointer,
            _sel_deviceCurrentTime,
          )
        : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_deviceCurrentTime);
  }

  /// duration
  double get duration {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.duration',
      macOS: (false, (10, 7, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_duration)
        : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_duration);
  }

  /// enableRate
  bool get enableRate {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.enableRate',
      macOS: (false, (10, 8, 0)),
    );
    return _objc_msgSend_91o635(object$.ref.pointer, _sel_enableRate);
  }

  /// format
  AVAudioFormatWrapper get format {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.format',
      macOS: (false, (10, 12, 0)),
    );
    final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_format);
    return AVAudioFormatWrapper.fromPointer($ret, retain: true, release: true);
  }

  /// init
  AVAudioPlayerWrapper init() {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.init',
      iOS: (false, (2, 0, 0)),
      macOS: (false, (10, 0, 0)),
    );
    final $ret = _objc_msgSend_151sglz(
      object$.ref.retainAndReturnPointer(),
      _sel_init,
    );
    return AVAudioPlayerWrapper.fromPointer($ret, retain: false, release: true);
  }

  /// initWithContentsOf:error:
  AVAudioPlayerWrapper? initWithContentsOf(objc.NSURL url) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.initWithContentsOf:error:',
      macOS: (false, (10, 7, 0)),
    );
    final $err = pkg_ffi.calloc<ffi.Pointer<objc.ObjCObjectImpl>>();
    try {
      final $ret = _objc_msgSend_1lhpu4m(
        object$.ref.retainAndReturnPointer(),
        _sel_initWithContentsOf_error_,
        url.ref.pointer,
        $err,
      );
      objc.NSErrorException.checkErrorPointer($err.value);
      return $ret.address == 0
          ? null
          : AVAudioPlayerWrapper.fromPointer(
              $ret,
              retain: false,
              release: true,
            );
    } finally {
      pkg_ffi.calloc.free($err);
    }
  }

  /// initWithContentsOf:fileTypeHint:error:
  AVAudioPlayerWrapper? initWithContentsOf$1(
    objc.NSURL url, {
    objc.NSString? fileTypeHint,
  }) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.initWithContentsOf:fileTypeHint:error:',
      macOS: (false, (10, 9, 0)),
    );
    final $err = pkg_ffi.calloc<ffi.Pointer<objc.ObjCObjectImpl>>();
    try {
      final $ret = _objc_msgSend_1pnyuds(
        object$.ref.retainAndReturnPointer(),
        _sel_initWithContentsOf_fileTypeHint_error_,
        url.ref.pointer,
        fileTypeHint?.ref.pointer ?? ffi.nullptr,
        $err,
      );
      objc.NSErrorException.checkErrorPointer($err.value);
      return $ret.address == 0
          ? null
          : AVAudioPlayerWrapper.fromPointer(
              $ret,
              retain: false,
              release: true,
            );
    } finally {
      pkg_ffi.calloc.free($err);
    }
  }

  /// initWithData:error:
  AVAudioPlayerWrapper? initWithData(objc.NSData data) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.initWithData:error:',
      macOS: (false, (10, 7, 0)),
    );
    final $err = pkg_ffi.calloc<ffi.Pointer<objc.ObjCObjectImpl>>();
    try {
      final $ret = _objc_msgSend_1lhpu4m(
        object$.ref.retainAndReturnPointer(),
        _sel_initWithData_error_,
        data.ref.pointer,
        $err,
      );
      objc.NSErrorException.checkErrorPointer($err.value);
      return $ret.address == 0
          ? null
          : AVAudioPlayerWrapper.fromPointer(
              $ret,
              retain: false,
              release: true,
            );
    } finally {
      pkg_ffi.calloc.free($err);
    }
  }

  /// initWithData:fileTypeHint:error:
  AVAudioPlayerWrapper? initWithData$1(
    objc.NSData data, {
    objc.NSString? fileTypeHint,
  }) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.initWithData:fileTypeHint:error:',
      macOS: (false, (10, 9, 0)),
    );
    final $err = pkg_ffi.calloc<ffi.Pointer<objc.ObjCObjectImpl>>();
    try {
      final $ret = _objc_msgSend_1pnyuds(
        object$.ref.retainAndReturnPointer(),
        _sel_initWithData_fileTypeHint_error_,
        data.ref.pointer,
        fileTypeHint?.ref.pointer ?? ffi.nullptr,
        $err,
      );
      objc.NSErrorException.checkErrorPointer($err.value);
      return $ret.address == 0
          ? null
          : AVAudioPlayerWrapper.fromPointer(
              $ret,
              retain: false,
              release: true,
            );
    } finally {
      pkg_ffi.calloc.free($err);
    }
  }

  /// isMeteringEnabled
  bool get isMeteringEnabled {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.isMeteringEnabled',
      macOS: (false, (10, 7, 0)),
    );
    return _objc_msgSend_91o635(object$.ref.pointer, _sel_isMeteringEnabled);
  }

  /// isPlaying
  bool get isPlaying {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.isPlaying',
      macOS: (false, (10, 7, 0)),
    );
    return _objc_msgSend_91o635(object$.ref.pointer, _sel_isPlaying);
  }

  /// numberOfChannels
  int get numberOfChannels {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.numberOfChannels',
      macOS: (false, (10, 7, 0)),
    );
    return _objc_msgSend_1hz7y9r(object$.ref.pointer, _sel_numberOfChannels);
  }

  /// numberOfLoops
  int get numberOfLoops {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.numberOfLoops',
      macOS: (false, (10, 7, 0)),
    );
    return _objc_msgSend_1hz7y9r(object$.ref.pointer, _sel_numberOfLoops);
  }

  /// pan
  double get pan {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.pan',
      macOS: (false, (10, 7, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_2cgrxlFpret(object$.ref.pointer, _sel_pan)
        : _objc_msgSend_2cgrxl(object$.ref.pointer, _sel_pan);
  }

  /// pause
  void pause() {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.pause',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_pause);
  }

  /// peakPowerForChannel:
  double peakPowerForChannel(int channelNumber) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.peakPowerForChannel:',
      macOS: (false, (10, 7, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_1o3b4v9Fpret(
            object$.ref.pointer,
            _sel_peakPowerForChannel_,
            channelNumber,
          )
        : _objc_msgSend_1o3b4v9(
            object$.ref.pointer,
            _sel_peakPowerForChannel_,
            channelNumber,
          );
  }

  /// play
  bool play() {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.play',
      macOS: (false, (10, 7, 0)),
    );
    return _objc_msgSend_91o635(object$.ref.pointer, _sel_play);
  }

  /// playAtTime:
  bool playAtTime(double time) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.playAtTime:',
      macOS: (false, (10, 7, 0)),
    );
    return _objc_msgSend_18chyc(object$.ref.pointer, _sel_playAtTime_, time);
  }

  /// prepareToPlay
  bool prepareToPlay() {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.prepareToPlay',
      macOS: (false, (10, 7, 0)),
    );
    return _objc_msgSend_91o635(object$.ref.pointer, _sel_prepareToPlay);
  }

  /// rate
  double get rate {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.rate',
      macOS: (false, (10, 8, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_2cgrxlFpret(object$.ref.pointer, _sel_rate)
        : _objc_msgSend_2cgrxl(object$.ref.pointer, _sel_rate);
  }

  /// setCurrentDevice:
  set currentDevice(objc.NSString? value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setCurrentDevice:',
      macOS: (false, (10, 13, 0)),
    );
    _objc_msgSend_xtuoz7(
      object$.ref.pointer,
      _sel_setCurrentDevice_,
      value?.ref.pointer ?? ffi.nullptr,
    );
  }

  /// setCurrentTime:
  set currentTime(double value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setCurrentTime:',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_hwm8nu(object$.ref.pointer, _sel_setCurrentTime_, value);
  }

  /// setEnableRate:
  set enableRate(bool value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setEnableRate:',
      macOS: (false, (10, 8, 0)),
    );
    _objc_msgSend_1s56lr9(object$.ref.pointer, _sel_setEnableRate_, value);
  }

  /// setIsMeteringEnabled:
  set isMeteringEnabled(bool value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setIsMeteringEnabled:',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_1s56lr9(
      object$.ref.pointer,
      _sel_setIsMeteringEnabled_,
      value,
    );
  }

  /// setNumberOfLoops:
  set numberOfLoops(int value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setNumberOfLoops:',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_4sp4xj(object$.ref.pointer, _sel_setNumberOfLoops_, value);
  }

  /// setPan:
  set pan(double value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setPan:',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_v5hmet(object$.ref.pointer, _sel_setPan_, value);
  }

  /// setRate:
  set rate(double value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setRate:',
      macOS: (false, (10, 8, 0)),
    );
    _objc_msgSend_v5hmet(object$.ref.pointer, _sel_setRate_, value);
  }

  /// setVolume:
  set volume(double value) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setVolume:',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_v5hmet(object$.ref.pointer, _sel_setVolume_, value);
  }

  /// setVolume:fadeDuration:
  void setVolume(double volume, {required double fadeDuration}) {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.setVolume:fadeDuration:',
      macOS: (false, (10, 12, 0)),
    );
    _objc_msgSend_1p4uk9e(
      object$.ref.pointer,
      _sel_setVolume_fadeDuration_,
      volume,
      fadeDuration,
    );
  }

  /// stop
  void stop() {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.stop',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_stop);
  }

  /// updateMeters
  void updateMeters() {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.updateMeters',
      macOS: (false, (10, 7, 0)),
    );
    _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_updateMeters);
  }

  /// url
  objc.NSURL? get url {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.url',
      macOS: (false, (10, 7, 0)),
    );
    final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_url);
    return $ret.address == 0
        ? null
        : objc.NSURL.fromPointer($ret, retain: true, release: true);
  }

  /// volume
  double get volume {
    objc.checkOsVersionInternal(
      'AVAudioPlayerWrapper.volume',
      macOS: (false, (10, 7, 0)),
    );
    return objc.useMsgSendVariants
        ? _objc_msgSend_2cgrxlFpret(object$.ref.pointer, _sel_volume)
        : _objc_msgSend_2cgrxl(object$.ref.pointer, _sel_volume);
  }
}
